import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Rank from '../views/Rank.vue'
import Me from '../views/Me.vue'
import PlayListDetail from '../components/playListDetail/PlayListDetail.vue'
import RankListDetail from '../components/rank/RankListDetail.vue'
import Player from '../components/player/Player.vue'
import { Search } from 'vant';

Vue.use(VueRouter)
Vue.use(Search);

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta:{
      showTab: true,
    },
  },
  {
    path: '/rank',
    name: 'Rank',
    component: Rank,
    meta:{
      showTab: true,
    },
  },
  {
    path: '/me',
    name: 'Me',
    component: Me,
    meta:{
      showTab: true,
    },
  },
  {
    path: '/playlistdetail/:id',
    name: 'PlayListDetail',
    component: PlayListDetail,
    meta:{
      showTab: false,
    },
  },
  {
    path: '/ranklistdetail/:id',
    name: 'RankListDetail',
    component: RankListDetail,
    meta:{
      showTab: false,
    },
  },
  {
    path: '/player/:mid/:id',
    name: 'Player',
    component: Player,
    meta:{
      showTab: false,
    },
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
